<template>
    <el-table :data="logData" border style="width: 100%">
        <el-table-column prop="username" label="登入账户" />
        <el-table-column prop="lastLogin.ip" label="上次登入IP" />
        <el-table-column prop="lastLogin.loginTime" label="上次登入时间" sortable />
        <el-table-column prop="nowLogin.ip" label="本次登入IP" />
        <el-table-column prop="nowLogin.loginTime" label="本次登入时间" />
    </el-table>
</template>
<script setup>
import { ref, onBeforeMount } from "vue";
import * as api from "../../../api/users"
let logData = ref([])
onBeforeMount(async () => {
    try {
        //发送请求获取日志数据
        let res = await api.getLoginLogApi()
        logData.value = res.data.data
        console.log(res);
    } catch (e) {
        console.log(e);
    }

})

</script>
<script>
export default {
    meta: {
        title: 'glsy',
        name: '管理首页',
        routeName:'welcome',
        icon:'icon-shouye1'
    }
}
</script>